3.6.51 \(\int \frac {\sec (c+d x)}{a+b \tan (c+d x)} \, dx\) [551]

Optimal. Leaf size=46 \[ -\frac {\tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2} d} \]

[Out]

-arctanh(cos(d*x+c)*(b-a*tan(d*x+c))/(a^2+b^2)^(1/2))/d/(a^2+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3590, 212} \begin {gather*} -\frac {\tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{d \sqrt {a^2+b^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]/(a + b*Tan[c + d*x]),x]

[Out]

-(ArcTanh[(Cos[c + d*x]*(b - a*Tan[c + d*x]))/Sqrt[a^2 + b^2]]/(Sqrt[a^2 + b^2]*d))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3590

Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-f^(-1), Subst[Int[1/(a^
2 + b^2 - x^2), x], x, (b - a*Tan[e + f*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x)}{a+b \tan (c+d x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,\cos (c+d x) (b-a \tan (c+d x))\right )}{d}\\ &=-\frac {\tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 45, normalized size = 0.98 \begin {gather*} \frac {2 \tanh ^{-1}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]/(a + b*Tan[c + d*x]),x]

[Out]

(2*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]])/(Sqrt[a^2 + b^2]*d)

________________________________________________________________________________________

Maple [A]
time = 0.16, size = 43, normalized size = 0.93

method result size
derivativedivides \(\frac {2 \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{d \sqrt {a^{2}+b^{2}}}\) \(43\)
default \(\frac {2 \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{d \sqrt {a^{2}+b^{2}}}\) \(43\)
risch \(\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}\, d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}\, d}\) \(88\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/d/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 80, normalized size = 1.74 \begin {gather*} -\frac {\log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a
^2 + b^2)))/(sqrt(a^2 + b^2)*d)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (44) = 88\).
time = 0.41, size = 131, normalized size = 2.85 \begin {gather*} \frac {\log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right )}{2 \, \sqrt {a^{2} + b^{2}} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*log(-(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*co
s(d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2))/(sqrt(a^2
+ b^2)*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*tan(d*x+c)),x)

[Out]

Integral(sec(c + d*x)/(a + b*tan(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.51, size = 74, normalized size = 1.61 \begin {gather*} -\frac {\log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 +
 b^2)))/(sqrt(a^2 + b^2)*d)

________________________________________________________________________________________

Mupad [B]
time = 3.75, size = 39, normalized size = 0.85 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\frac {b-a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{d\,\sqrt {a^2+b^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)*(a + b*tan(c + d*x))),x)

[Out]

-(2*atanh((b - a*tan(c/2 + (d*x)/2))/(a^2 + b^2)^(1/2)))/(d*(a^2 + b^2)^(1/2))

________________________________________________________________________________________